#include "Comm.hpp"

int main()
{
    int wfd = open(Path, O_WRONLY);
    if(wfd < 0) 
    {
        cerr<<"open fail, errono "<< errno << ", errstring : "<< strerror(errno)<<endl;
        return 100;
    }
    
    string inbuffer;
    while(true)
    {
        cout<<"Please entre your message of you want"<<endl;
        getline(cin,inbuffer);
        if(inbuffer == "quit") break;
        ssize_t n = write(wfd, inbuffer.c_str(), sizeof(inbuffer));
        if(n < 0)
        {
            cerr<<"write fail errno"<<errno<<", errstring : "<< strerror <<endl;
            break;
        } 
    }

    close(wfd);
    return 0;
}